package com.woniuxy.pxxt.controller;


import com.woniuxy.pxxt.common.result.Result;
import com.woniuxy.pxxt.common.vo.test.TestVo;
import com.woniuxy.pxxt.entity.Option;
import com.woniuxy.pxxt.entity.Test;
import com.woniuxy.pxxt.service.OptionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.nio.file.OpenOption;

/**
 * 包含对应的选择题的选项(PxxtOption)表控制层
 *
 * @author makejava
 * @since 2022-03-07 16:33:15
 */
@Api(value = "包含对应的选择题的选项")
@RestController
@RequestMapping("/option")
public class OptionController {

    @Autowired
    private OptionService optionService;

    @ApiOperation(value = "添加试题选项")
    @PostMapping("/addOptiones")
    public Result addOptiones(@RequestBody TestVo test){

        return optionService.addOptiones(test);
    }

    @ApiOperation(value = "删除试题选项")
    @PostMapping("/deleteOptionesByTestId")
    public Result deleteOptionesByTestId(Integer testId){
        return optionService.deleteOptionesByTestId(testId);
    }

    @ApiOperation(value = "根据试题id获取对应试题选项")
    @PostMapping("/findOptionesByTestId")
    public Result findOptionesByTestId(@RequestBody Option option){
        return optionService.findOptionesByTestId(option);
    }


}

